package lj.fx.tool.component;

import cn.hutool.core.util.RandomUtil;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;

/**
 * 矩形
 */
public class ComRectangle extends Rectangle {

    public static ComRectangle randomShape() {
        ComRectangle r = new ComRectangle();
        r.setX(RandomUtil.randomInt(10, 100));
        r.setY(RandomUtil.randomInt(10, 100));
        r.setWidth(RandomUtil.randomInt(10, 100));
        r.setHeight(RandomUtil.randomInt(10, 100));

        // 设置圆角
        r.setArcHeight(15);
        r.setArcWidth(15);

        r.setStroke(Color.BLACK);

        return r;
    }
}
